package com.toocms.jinjuhang.ui.mine.involved_result.details

import android.app.Application
import androidx.core.graphics.drawable.DrawableCompat
import androidx.databinding.ObservableArrayList
import androidx.databinding.ObservableField
import com.blankj.utilcode.util.ResourceUtils
import com.toocms.jinjuhang.BR
import com.toocms.jinjuhang.R
import com.toocms.jinjuhang.ui.system.ImageItemModel
import com.toocms.tab.base.BaseModel
import com.toocms.tab.base.BaseViewModel
import com.toocms.tab.binding.ItemBinding
import com.toocms.tab.binding.command.BindingAction
import com.toocms.tab.binding.command.BindingCommand

class InvolvedResultDetailsModel(application: Application):BaseViewModel<BaseModel>(application) {

    val proveImageItems = ObservableArrayList<ImageItemModel>()
    val proveImageItemBinding = ItemBinding.of<ImageItemModel>(BR.imageItemModel, R.layout.item_image)

    val backObservableField by lazy {
        val content = ResourceUtils.getDrawable(R.mipmap.icon_arrow_left_black).mutate()
        DrawableCompat.setTint(content, 0xFFFFFFFF.toInt())
        ObservableField(content)
    }
    val backClickBindingCommand = BindingCommand<BindingAction>(this::finishFragment)

    init {
        proveImageItems+=ImageItemModel(this)
        proveImageItems+=ImageItemModel(this)
        proveImageItems+=ImageItemModel(this)
        proveImageItems+=ImageItemModel(this)
        proveImageItems+=ImageItemModel(this)
        proveImageItems+=ImageItemModel(this)
        proveImageItems+=ImageItemModel(this)
        proveImageItems+=ImageItemModel(this)
        proveImageItems+=ImageItemModel(this)
    }

}